package com.lovepick;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.view.MenuItem;

import com.lovepick.fragment.OrderInfoFragment;

public class OrderInfoActivity extends FragmentActivity
{
	private static final String FTAG_ORDER_INFO = "order_info";
	private Fragment mFragment;

	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.order_info_activity);

		Bundle args = getIntent().getBundleExtra("bundle_order_info");
		if (args != null)
		{
			mFragment = OrderInfoFragment.createInstance(args);
		}

		getActionBar().setDisplayHomeAsUpEnabled(true);
		FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
		ft.add(R.id.container, mFragment, FTAG_ORDER_INFO).commit();
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item)
	{
		switch (item.getItemId())
		{
			case android.R.id.home:
				finish();
				return true;

			default:
				return super.onOptionsItemSelected(item);
		}
	}

}
